<?php
	header("Content-type:text/html;charset=utf8");

	//登录
	if(!isset($_POST['submit'])){
		exit('亲，检查下你的信息是否填写正确');
	}

	$tel = $_POST["tel"];
	$pwd = $_POST["pwd"];
	
	//包含数据库连接文件
	include 'link.php';
	
	$sql = "select * from users where tel='$tel' and user_pwd='$pwd'";
	
 	$query = mysqli_query($link, $sql);
	
 	$rows = mysqli_fetch_array($query);
 	
  	print_r($rows);
  	exit(0);
	
	if($rows){
		//登录成功
		session_start();
		$id = $rows['user_id'];
		$userName = $rows['user_name'];
		$tel = $rows['tel'];
		$_SESSION['user_id'] = $id;
		$_SESSION['user_name'] = $userName;
		$_SESSION['tel'] = $tel;
// 		$_SESSION['userid'] = $result['userid'];
		// echo $userName . '欢迎你！';
		echo "<p style='text-align:center;margin-top:50px;font-size:16px;'>
				点击返回<a href='index.php'><span style='color:red'>首页</span></a> | 
					<a href='user_zone.php'>个人中心</a>。
				</p>";
		// echo '点击此处 <a href="handle_login.php?action=logout">注销</a> 登录！<br />';
		// header("Location:index.php");
		exit;
	} else {
		exit('<p style="text-align:center;margin-top:50px;font-size:16px;">
				登录失败！点击此处 <a href="javascript:history.back(-1);">返回</a> 重试
			</p>');
	}
	
	
	
	
	
	